package actions.commandsmap

import actions.commandsmap.commands.Command
import actions.commandsmap.commands.SelectCommand
import actions.commandsmap.commands.TypeCommand
import dsl.parameters.Parameter

class CreateMovieMapper implements Mapper {
    Map<Parameter, Command> mapParametersCommands(List<Parameter> parameters) {
        def commandsMap = new HashMap<Parameter, Command>()
        parameters.each {
            switch (it.name) {
                case "movieType":
                    commandsMap.put(it, new SelectCommand(it.value, it.name))
                    break;
                default:
                    commandsMap.put(it, new TypeCommand(it.value, it.name))
            }
        }
        return commandsMap
    }
}
